1. Field of the Invention
The present invention relates to an improved defects inspection method of a three-dimensional shape.
2. Description of the Related Art
As a method of detecting surface defects of a three-dimensional work for instance, Japanese Unexamined Patent Application Publication No. 10-10053 discloses a method of detecting a defect based on a change or a differential at the boundaries of patterns by irradiating striped-pattern beams on the work.
However, this method detects the presence or absence of defects based simply on changes in the brightness on the work. Thus, it is difficult for the method to detect defects on the surface of work that can form shadows due to complex projections or recessed shapes or that have different shades due to oil contamination or marking made by a marker. This method often produces false alarms by detecting normal marks caused by oil contamination or markings made by a marker as defects.
In order to solve such a problem, defect inspection methods have been invented which use the three-dimensional shape of an object being inspected in accordance with know trigonometric measurement principles.
The principle of a defect inspection method using a three-dimensional shape based on trigonometric measurement principle is explained briefly with reference to FIG.6(a).
A light projector 1, for example, a laser beam, emits a beam which is directed by a mirror 3 to linearly irradiate a work 2 with a pattern having a width in the thickness direction (X-axis direction) of FIG. 6(a). A mirror driving means (not shown in the figure) rocks the mirror 3 at a predetermined pitch in a direction which moves the locus of radiation orthogonal to the linear irradiation, in other words, in a direction which moves the radiation in the right-to-left direction (Y-axis direction) of FIG. 6(a). A rotating position detecting means (not shown in the figure) detects the rocking position of the mirror 3. A camera 4 takes a picture of the work 2 at each rocking position of the mirror 3 by maintaining a predetermined relative position with respect to the mirror 3. An image processing unit 5 finds the projection/recess shapes of the work 2 by storing a value (mentioned as a distance code hereinafter) indicating the rocking angle of the mirror 3 for a matrix of laser beam detecting positions in a camera coordinate system of the camera 4 for which the linear direction of the irradiation and the moving locus of radiation are two orthogonal axes.
A line L1(xcex1) shown in FIG. 6(a) is the optical path of the laser beam that is reflected by the mirror 3 to irradiate the work 2. A line L2 is a straight line connecting the point on the work 2 irradiated by the laser beam to the camera 4.
The position of the mirror 3 relative to the camera 4, in other words, the length of the straight line connecting the mirror 3 and the camera 4, remains constant. An angle between the straight line connecting the mirror 3 and the camera 4 and the line L1 is easily found given knowledge of the rocking angle of the mirror 3.
An angle between the straight line connecting the mirror 3 and the camera 4, and the line L2 is calculated as an angle between the line L2 and the optical axis of the camera 4 on the basis of the detected laser beam position on a camera coordinate system of the camera 4.
Accordingly, although it is possible to find distance between the camera 4 and the work 2 in accordance with the trigonometrical measurement principle, the computation is complex and requires a long time for computation. Thus, instead of calculating the distance between the camera 4 and the work 2, the rocking angles of the mirror 3 which are related to the distances, are stored as a corresponding matrix of a laser beam detecting position on a camera coordinate system of the camera 4. Therefore, the shape of the work 2 is stored and the need for a complex computation is omitted.
For instance, if it is assumed that a matrix (X, Y) on a camera coordinate system for which the linear direction of the irradiation and the moving locus direction of the irradiation are two orthogonal axes consists of n-row by m-column matrix elements (i1, j1) to (in, jm). Then, if the rocking angle of the mirror 3 is xcex1 when the irradiated beam is detected at (X (x=1 to n), j) on the camera coordinate system as shown in FIG. 6(a), the xcex1 value is stored in all of the n matrix elements in the X-axis direction of the matrix (X (x=1 to n), j) on the camera coordinate system. It is found that the height of the work 2 (shown only with a solid line) is the same at a section where radiation hits, since the xcex1 value is constant.
If there is a protrusion 2f (as shown with a chain line in FIG. 6(a)) at the location (i, j) on the surface of the work 2, the irradiation does not hit the top face of the protrusion 2f when the rocking angle of the mirror 3 is xcex1. Irradiation hits the top face of the protrusion 2f when, for example, the rocking angle of the mirror 3 is xcex1xe2x80x2. Thus, the xcex1xe2x80x2 value is stored only at the position of the protrusion 2f, which is (i, j), among the n matrix elements in the X-axis direction of the matrix (X(x=1 to n), j) on the camera coordinate system Accordingly, the existence of the protrusion 2f on the work 2 is confirmed based on a difference between the rocking angles xcex1 and xcex1xe2x80x2.
The processing unit 5 repeatedly executes the above-mentioned processing; that is the rocking angles of the mirror 3, in other words, distance code values are stored at each rocking position of the mirror 3 for a matrix of a laser beam detecting positions in the camera coordinate system of the camera 4 while the mirror 3 is rocked to shift the radiation in the Y-axis direction.
FIG. 7(a) is one example of an image when a distance code value on each matrix is shaded and visualized by making a distance code value stored at each matrix element correspond to a gray-scale density. For instance, the distance code value is 0 (black on a gray scale) when the irradiation is at the right end of the work 2, and the distance code value is 255 (white on a gray scale) when the irradiation is at the left end of the work 2. Such an image is referred to as a distance code image hereinafter.
When a surface defect of the work 2 is detected based on such a principle, the projection/recess shape of the perfect work 2 is first found by the image processing unit 5. Then. the distance code image of the perfect work 2 is obtained as shown in, for instance, FIG. 7(a). The distance code image is mentioned as a distance code image as a reference.
Subsequently, the projection/recess shape of the inspected work 2 is similarly found as described above by the image processing unit 5, thus obtaining a distance code image of the inspected work 2. FIG. 7(b) is an example of a distance code image obtained from the inspected work 2 having a defect 6 at the center.
Then, the presence/absence of a defect on the inspected work 2 is determined by a comparison at each matrix element (ix (x=l to n), jy (y=l to m)) between distance codes stored in a reference distance code image obtained from the perfect work 2, and distance codes stored in a distance code image obtained from the inspected work 2.
Specifically, a reference distance code image as shown in FIG. 7(a) is first compared with a distance code image as an inspection object shown in FIG. 7(b) to find a difference of distance codes at each matrix element (ix (x=l to n), jy (y=l to m)). This difference is stored for each matrix element (ix (x=l to n), jy (y=l to m)). As the scale of a difference of distance codes is visualized as a corresponding gray-scale density, as described above, an image shown in, for example, FIG. 7(c) is obtained. Such an image is referred to as a differential distance code image hereinafter.
Furthermore, as image processing is carried out for the differential distance code image by eliminating noise or the like, the defect 6 becomes visible and the presence/absence of a defect on the inspected work 2 is easily determined. Such an image is mentioned as a defect extracting image hereinafter.
As such a method is applied, the presence/absence of a defect is determined based on an absolute difference in projection/recess shapes of the surface of the work 2. Thus, a defect is properly detected while significantly reducing negative effects due to a change in density of the image which is caused by shadows on the work 2, oil contamination, markings made by a marker, or the like.
However, in the trigonometrical measurement principle, the rocking position of the mirror 3 has to be controlled with high precision. If there is a slight error in the rocking position of the mirror 3, a serious error is found in distance codes relating to the surface shapes of the work 2.
Subsequently, the reasons why such a problem is found will be explained briefly by referring to FIGS. 8(a) to 8(e). FIG. 8(a) is an example of a shape of the work 2 where a distance code image is obtained. The work 2 has a peripheral groove 2a having a rectangular cross-section at the outer periphery and a peripheral groove 2b having a wedge-shaped cross-section. The work 2 has a flat part 2c that is curved in a recessed shape at the center thereof.
A-Axe2x80x2 in FIG. 8(a) shows the linear direction (X-axis direction) of laser beams irradiated from the mirror 3, and B-Bxe2x80x2 indicates the direction (Y-axis direction) of a moving locus of radiation.
Only the flat Dart where the linear direction (X-axis direction) of radiation on the work 2 overlaps with the line B-Bxe2x80x2 is focused upon, and FIG. 8(b) shows the data of relations between matrices of laser beam detecting positions and distance codes at a reference temperature (for instance, 15xc2x0 C.). In FIG. 8(b), while distance code 0 is a reference value at the right end of the work 2, distance code 255 is a reference value at the left end of the work 2. The data is visualized to horizontally locate these values.
The height of the work 2 is always constant in this example without depending on where beams radiate on B-Bxe2x80x2, in otherwords, which rocking position the mirror 3 has. Thus, the graph in FIG. 8(b) is flat with a constant Z value where the direction of a moving locus of radiation (Y-axis direction) is the horizontal axis and the height of the work 2 is the vertical axis (Z-axis direction).
FIG. 8(c) shows relations between matrices of laser beam detecting positions and distance codes when the same work 2 is measured at a temperature higher than the reference temperature. As clearly shown in FIG. 8(b) and FIG. 8(c), in the distance code data measured at the temperature higher than the reference temperature, the reference values of distance codes are adjusted so as to provide the same height at the right and left ends of the work 2. However, as radiation shifts toward the right side (+ direction of Y-axis) of the work 2, incorrect measurement results are obtained as if distance codes values gradually increase.
This is an abnormality of measurement due to the error of rocking positions of the mirror 3 mentioned above. For instance, it is assumed that, in FIG. 6(b), the mirror 3 moves to 3b instead of 3a as a correct rocking position, due to a positional error caused by the temperature rise. If the mirror 3 is at the correct position 3a to irradiate the laser beam along the line L1 and the camera 4 can capture the laser beam at the position (X(x=l to n), j) on the camera coordinate system, the rocking angle of the mirror 3, in other words, the distance code value, corresponds thereto and is stored.
However, the mirror 3 is actually displaced to 3b. Although laser beam is irradiated along the line L1xe2x80x2 and detected at (X(x=l to n), j+xcex94j) on the camera coordinate system, the image processing unit 5 itself does not recognize it and determines that the laser beam irradiated along the line L1 is detected at (X(x=l to n), j+xcex94j) on the camera coordinate system. As a result, the image processing unit 5 stores the distance code xcex1 corresponding to a rocking angle, which should have been primarily stored at (X(x=l to n),j+xcex94j) on the camera coordinate system, at the position of (X(x=l to n),j+xcex94j) on the camera coordinate system (position where xcex1 should have been stored as a primary distance code). Accordingly, an incorrect measurement results as shown in FIG. 8(c). In other words, the a distance code which is larger than the primary xcex1xe2x80x2 distance code, is stored at the position to the right end on the camera coordinate system, so that a contradiction, as shown in FIG. 8(c), is found. Moreover, as clearly shown in FIG. 6(a), it is determined that the height of a surface is higher at a section with a smaller distance code (xcex1xe2x80x2 less than xcex1) at each matrix position on the same line with the same Y on the camera coordinate system, for example, at (X(x=l to n),j).
FIG. 9(a) shows an example of a distance code image formed on the basis of distance codes which are measured at a temperature higher than the reference temperature. The distance code image shown in FIG. 9(a) is compared with the distance code image prepared at the reference temperature shown in FIG. 7(a) to find differences of the distance codes. Then, a differential distance code image as shown in FIG. 9(b) is obtained. As clearly shown in FIG. 9(b), the difference values become large toward the right side (+ direction of the Y-axis) of the differential distance code image due to the above-mentioned distance code error. When a defect extracting image is formed based on the differential distance code image, an area having large differences remains at the right side (+ direction of the Y-axis) section where no defects primarily exist. This section is extracted as a defect, so that the work 2 that is primarily a good product, is determined to be an inferior product.
As a method to solve such a problem, distance code images are prepared as references at various temperatures, and the reference distance code images are chosen depending on the temperature under which an inspection is performed.
However, in order to prepare a plurality of distance code images as references, the image processing unit 5 must have a large memory. Moreover, due to temperature changes depending on time even in the same day, distance code images as references have to be repeatedly re-selected within the same day and measurement procedures become troublesome.
On the contrary, temperature could be kept constant by controlling the measurement environment. However, in this case, the equipment required for temperature control is large, which is troublesome.
Accordingly, it is an object of the present invention to solve the conventional problems mentioned above, and to provide a defect inspection method of a three-dimensional shape that can accurately inspect detects on a work surface without changing the settings in accordance with temperature changes, and without actively controlling the temperature of the environment.
The defect inspection method of a three-dimensional shape according to the present invention provides a light projector emitting a laser beam, a mirror to reflect the laser beam from the light projector to linearly irradiate a work, a mirror driving means to rock the mirror at a predetermined pitch in a direction where a moving locus of the irradiation is orthogonal to the linear irradiation, a camera to take a picture of the work at each rocking position of the mirror by maintaining a predetermined position with respect to the mirror and an image processing unit to find a projection/recess shape of the work by storing values which indicate rocking angles of the mirror for laser beam detecting positions on a camera coordinate system for which the linear direction of the irradiation and the direction of a moving locus of the irradiation are two orthogonal axes. A projection/recess shape of a perfect work is found and then stored by the image processing unit in advance. Then, a projection/recess shape of an inspected work is found by the image processing unit. The presence/absence of a detect on the inspected work is inspected by comparing, at each matrix element, a value indicating a rocking angle of the mirror stored for the perfect work to a value indicating a rocking angle of the mirror stored for the inspected work. In order to achieve the object above, in particular, a difference is found between a value indicating a rocking angle of the mirror stored for the perfect and a value indicating a rocking angle of the mirror stored for the inspected work, at each matrix element. This difference is stored for each matrix element. A most frequent difference value is found among matrix elements in a linear direction of the irradiation for each column of the matrix elements arranged in a direction of the irradiation. Matrix elements having differences deviating from the most frequent difference value by more than a set level are found at each column of the matrix elements. These elements are stored as defect candidates. Then, the presence/absence of defects on the inspected work is determined based on all the existing states of the matrix elements as defect candidates on the matrix.
Subsequently, the principles of how the invention solves the conventional problems will be explained.
First, a light projector, a mirror driving means, a camera, and an image processing unit are operated. As in the conventional art, the projection/recess shape of a perfect work is found and then stored by storing values indicating rocking angles of the mirror, in other words, distance codes, for a matrix of a camera coordinate system for which the linear direction of the irradiation and the moving locus of the irradiation are two orthogonal axes. Accordingly, a distance code image shown in, for instance, FIG. 7(a) is obtained as a reference.
Subsequently, as mentioned above, the light projector, the mirror driving means, the camera, and the image processing unit are operated repeatedly. A distance code is stored for a matrix of a camera coordinate system for which the linear direction of the irradiation and the moving locus of the irradiation are two orthogonal axes, and the projection/recess shape of the inspected work is found. Accordingly, a distance code image shown in, for example, FIG. 9(a) is obtained. Normally, environmental temperature is different from the temperature when the distance code image was obtained as a reference. Thus, the distance code image shown in FIG. 9(a) has an error in distance codes due to a positional shift of the mirror or a detection error (nonlinear shift, origin drift, or the like) of rocking positions caused by temperature drift or the like of a rotating position detecting means for detecting the rocking position of the mirror.
Subsequently, the difference between the distance codes of the perfect work and the distance codes of the inspected work at each matrix element for which the direction of the irradiation and the direction of a moving locus of the irradiation are two orthogonal axes. This difference is then stored for each matrix element. Accordingly, a differential distance code image shown in, for example, FIG. 9(b) is obtained. Since the distance code image of the inspected work has an error by itself, the difference values of distance codes increase toward the end of the work, as shown in FIG. 8(c).
However the distance code image of the inspected work has errors because of the drift of rocking angles of the mirror or the erroneous recognition of rocking angles. Thus, the distance codes stored for matrix elements in the same column in the direction of irradiation should all have equal errors. For instance, when the work 2 shown in FIG. 8(a) is inspected, the distance code data at the end of the work 2 measured at the reference temperature is shown as a broken line in FIG. 8(d) where the horizontal axis is the linear direction (X-axis direction) of irradiation. Moreover, the distance code data at the end of the work 2 measured at a temperature higher than the reference temperature is shown as a solid line in FIG. 8(d). Thus, either the distance code data of the work 2 measured at the reference temperature or the distance code data of the work 2 measured at a temperature higher than the reference temperature is shifted, and both are overlapped as shown in FIG. 8(e). Then, the presence/absence of a surface defect is found by determining the presence/absence of mismatching distance code data at each position in the column of matrix elements in the direction of irradiation (X-axis direction).
First, most frequent difference values are found at each column of matrix elements arranged in the direction of the irradiation, among matrix elements in the linear direction of the irradiation. When the inspected work 2 has no defects on its surface, both should match completely, as in FIG. 8(e), when the distance code data of the work 2 measured at the reference temperature is overlapped with the distance code data of the work 2 measured at a temperature higher than the reference temperature. In this case, all the difference values found in matrix elements in the linear direction of irradiation are equivalent to xcex94Z. It is obvious that differences other than xcex94Z are sometimes detected when the work 2 has a projection/recess defect on its surface. However, since the surface of the work 2 is not normally severely damaged, most frequent differences in matrix elements in the linear direction of the irradiation are always equivalent to xcex94Z in FIG. 8(d). This xcex94Z is equivalent to a shift quantity. Furthermore, xcex94Z because a distance code error itself due to a positional shift of the mirror or a detection error (nonlinear shift, origin drift, or the like) caused by temperature drift or the like of a rotating position detecting means for detecting the rocking position of the mirror.
Subsequently, matrix elements having differences which deviate from the most frequent difference value (xcex94Z) by more than a set value are found at each column of matrix elements arranged in the direction of the irradiation, and are stored as defect candidates. The matrix element section having differences deviating from the most frequent difference value (xcex94Z) by more than a set value is a section where the distance code data of the work measured at the reference temperature and the distance code data of the work measured at a temperature higher than the reference temperature do not match each other, even by shifting the distance code data. This indicates that the section has projection/recess defects.
Finally, the presence/absence of defects on an inspected work is determined in accordance with the existing state of all matrix elements which is defect candidates on a matrix. That is, all the defect candidates within a projection plane of the work for which the linear direction of irradiation and the direction of a moving locus of irradiation are found along two orthogonal axes. For instance, when a point defect candidates are found, it is considered to be simply a measurement mistake. It is also possible to determine that a work has no abnormality. When defect candidates are close to each other over a certain area, it is possible to clearly determine that they are surface defects.
Therefore, the scale (xcex94Z) of a distance-measuring code error caused by a position shift of the mirror or a detection error (nonlinear shift, origin drift or the like) due to temperature drift or the like of a rotating position detecting means for detecting the rocking portion of the mirror is found. Then, a test is performed to determine whether or not the distance code data of the work measured at the reference temperature match the distance code data of the work measured at a temperature higher than the reference temperature by shifting the distance code data by an amount equivalent to an error. Accordingly, appropriate defect inspection can always be performed independently of temperature differences during measurement.
The problems are solved as described above even when the measurement is performed at a temperature lower than the reference temperature.
In order to achieve the same object as above for each projection/recess shape of a perfect work and projection/recess shape of an inspected work, a value which indicates a most frequent rocking angle of a mirror is found among matrix elements in the linear direction of irradiation at each column of matrix elements arranged in the direction of irradiation. In order to match the values that indicate most frequent rocking angles of a mirror in the projection/recess shape of a perfect work and projection/recess shape or an inspected work, the values for the inspected work are shifted at each column of matrix elements arranged in the direction of irradiation. Then, the values indicating rocking angles of the mirror that are stored for the perfect work are compared, at each matrix element, with the values indicating rocking angles of the mirror that are stored for the inspected work, so as to detect the presence/absence of defects on the inspected work.
In this case, the values indicating the most frequent rocking angles of a mirror are equivalent to a straight line having the maximum length in the linear direction of irradiation on a work. (However, this is based on the assumption that the straight line is orthogonal to the optical axis of a camera.) Thus, this straight line is specified at each perfect work and an inspected work. Then. the data values indicating rocking angles of a mirror are shifted and compared at each column of matrix elements arranged in the direction of irradiation so as to overlap these straight lines. This permits proper detection of defects regardless of temperature differences during measurement. This shift quantity is equal to the scale (xcex94Z) of a distance code error caused by the above-mentioned position shift of the mirror or error (nonlinear shift, origin drift, or the like) due to temperature drift or the like of a rotating position detecting means for detecting the rocking position of the mirror.
The above, and other objects, features and advantages of the present invention will become apparent from the following description read in conjunction with the accompanying drawings, in which like reference numerals designate the same elements.